#!/usr/bin/python
import os,sys

def saltos(k):
	nodos = 4*k
	aristas = 6*k-1

	print "%d %d" % (nodos,aristas)

	camino = range(0,k*3)
	saltos = range(k*3,nodos)
	
	for i in range(0,len(camino)-1):
		print "%d %d" % (camino[i],camino[i+1])
	for i in range(0,len(camino)-1):
		print "%d %d" % (camino[i],saltos[i % 3])

def main():
	st = int(sys.argv[1])	
	end = int(sys.argv[2])
	for i in range(st,end):
		saltos(k)

if __name__ == "__main__":
	main()
